---
import ProfileDetails from '../../components/Profile/profile-details';
import BaseLayout from '../../layouts/BaseLayout.astro';
---

<BaseLayout title='Profile'>
  <div class='container'>
    <ProfileDetails client:idle />
  </div>
</BaseLayout>

<script>
  import Cookies from 'js-cookie';
  import { TOKEN_COOKIE_NAME } from '../../lib/constants';
  const token = Cookies.get(TOKEN_COOKIE_NAME);
  if (!token) {
    window.location.href = '/';
  }
</script>
